home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / 3d_hyper / 3d_hyper.dcr / Scripts_2_menuFrame.ls < prev    next >
Encoding:
Text File  |  2011-06-09  |  1.4 KB  |  68 lines

  1. property pPlaceToGo, pTimeLeaving, pReadyToGo, pInitialized
  2. global gChosenCar, gHaveSound
  3.  
  4. on beginSprite me
  5.   stopSounds()
  6.   initializeGlobals()
  7.   pInitialized = 0
  8.   preloadModels()
  9.   pTimeLeaving = 0
  10. end
  11.  
  12. on beginMusic me
  13.   if gHaveSound then
  14.     if not sound(1).isBusy() then
  15.       sound(1).play(member("cracermusic"))
  16.       sound(1).volume = 120
  17.     end if
  18.   end if
  19. end
  20.  
  21. on exitFrame me
  22.   if not pInitialized then
  23.     chooseRenderer(#NonDTS)
  24.     pInitialized = 1
  25.     beginMusic()
  26.   end if
  27.   if the shiftDown then
  28.     sendAllSprites(#keyWasPressed, #Shift, "Shift")
  29.   else
  30.     if the controlDown then
  31.       sendAllSprites(#keyWasPressed, #Control, "Control")
  32.     else
  33.       if the optionDown then
  34.         sendAllSprites(#keyWasPressed, #ALT, "Alt")
  35.       end if
  36.     end if
  37.   end if
  38.   exitKeysPressed()
  39.   if (the milliSeconds > pTimeLeaving) and (pTimeLeaving > 0) then
  40.     if pReadyToGo then
  41.       go(pPlaceToGo)
  42.     else
  43.       pReadyToGo = 1
  44.       go(the frame)
  45.     end if
  46.   else
  47.     go(the frame)
  48.   end if
  49. end
  50.  
  51. on choseCar me, whichCar
  52.   gChosenCar = whichCar
  53.   setupRacers(whichCar)
  54.   me.LeaveFrame("Tweak Car")
  55. end
  56.  
  57. on keyDown me
  58.   put the key && the keyCode
  59.   sendAllSprites(#keyWasPressed, the keyCode, the key)
  60. end
  61.  
  62. on LeaveFrame me, whichFrame
  63.   timeToLeave = 1500
  64.   sendAllSprites(#LeaveThisFrame, timeToLeave)
  65.   pPlaceToGo = whichFrame
  66.   pTimeLeaving = the milliSeconds + timeToLeave
  67. end
  68.